Enhance job feed handling and database mappings#99
Merged
sghf merged 5 commits intoopensvc:mainfrom Jan 30, 2026
Merged
Conversation
Contributor
cgalibern
commented
Jan 29, 2026
- Correct `begin` mapping in the `hbmon_log_last` upsert query. - Adjust error message in `job_feed_daemon_status.go` for `heartbeatToDB` to improve clarity.
…atus` - Add checks for unregistered nodes and peer-nodes with detailed debug logging.
Refactor row count handling by introducing `ExecContextAndCountRowsAffected` on cdb.DB
- Simplify row count handling in `job_feed_system.go` and `job_feed_node_disk.go` by replacing redundant code with `ExecContextAndCountRowsAffected`.
- Add `ExecContextAndCountRowsAffected` utility function to `cdb/db.go` for consistent query execution and row count retrieval.
- Fix nil pointer
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xceda8e]
goroutine 2289 [running]:
github.com/opensvc/oc3/worker.(*jobFeedSystem).targets(0xc0003ec000, {0x2303e98, 0x29b12c0})
.../worker/job_feed_system.go:157 +0x4ce
github.com/opensvc/oc3/worker.runOps({0x2303e98, 0x29b12c0}, {0xc0000945a0?, 0x0?, 0xc0000360f0?})
.../worker/base_job.go:89 +0xf7
github.com/opensvc/oc3/worker.RunJob({0x2303e98, 0x29b12c0}, {0x2302858, 0xc0003ec000})
.../worker/base_job.go:52 +0x285
github.com/opensvc/oc3/worker.(*Worker).runJob(0xc0003b6e10, {0xc0003e2260, 0x2, 0x0?})
.../worker/worker.go:202 +0x1306
github.com/opensvc/oc3/worker.(*Worker).Run.func1.1({0xc0003e2260?, 0x0?, 0x0?})
.../worker/worker.go:96 +0x5c
created by github.com/opensvc/oc3/worker.(*Worker).Run.func1 in goroutine 32
.../worker/worker.go:94 +0x67
…t` utility in `cdb`. - Replaced verbose `ExecContext` and `RowsAffected` logic with `execCountContext` for consistent row count retrieval across database operations. - Improved code clarity and reduced redundancy across several modules in `cdb`. - Fix potential nil pointer dereference in the result returned by execContext
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.